package com.xunk.common.core.enums.dnake;

import com.xunk.common.core.enums.DeviceEnum;

/**
 * @Author: wangTong
 * @Description: 狄耐克设备类型枚举
 * @Date: 2021/5/12 10:50
 * @Version: 1.0
 */
public enum DnakeDeviceTypeEnum {
    UNDEFINED("0", DeviceEnum.UNKNOWN,"未定义设备"),
    DNAKE_ONE_KEY_SWITCH("256-1", DeviceEnum.ONE_KEY_SWITCH,"狄耐克单键开关"),
    DNAKE_TWO_KEY_SWITCH("256-2", DeviceEnum.TWO_KEY_SWITCH,"狄耐克双键开关"),
    DNAKE_THREE_KEY_SWITCH("256-3", DeviceEnum.THREE_KEY_SWITCH,"狄耐克三键开关"),
//    ONOFFLIGHT(257, "onofflight","开关灯"),
//    DIMMERLIGHT(258, "dimmerlight","调光灯"),
//    COLORLIGHT(259,"colorlight", "彩色灯"),
//    LINKPANEL(260, "linkpanel","联控面板"),
//    DIMLINKPANEL(261, "dimlinkpanel","调光联动面板"),
    CURTAIN_1("514-1", DeviceEnum.WINDOW_CURTAIN,"窗帘设备"),
    CURTAIN_2("514-2", DeviceEnum.TWO_KEY_WINDOW_CURTAIN,"窗帘设备"),
    CURTAIN_3("514-3", DeviceEnum.THREE_KEY_WINDOW_CURTAIN,"窗帘设备"),
//    CURTAINCONTROLLER(515, "curtaincontroller","窗帘联动设备"),
//    AIR(768, "air","中央空调"),
//    LINKAIR(769, "linkair","空调联控"),
//    SWITCH(1024, "switch","电器开关"),
//    IR(1280, "ir","红外设备"),// 包括：电视、空调、机顶盒等红外
//    IR_AIR(1281, "ir_air","红外设备空调"),
//    IR_TV(1282, "ir_tv","红外设备电视"),
//    IR_BOX(1283, "ir_box","红外设备机顶盒"),
//    IR_DVD(1284, "ir_dvd","红外设备DVD"),
//    IR_FAN(1285, "ir_fan","红外设备电风扇"),
//    IR_SWEEP(1293, "ir_sweep","红外设备扫地机"),
//    THERMOSTAT(1293, "thermostat","温控器"),
//    FRESH(1293, "fresh","新风系统"),
//    FRESHCONTROLLER(1293, "freshcontroller","新风联动"),
//    FHEAT(1293, "fheat","地暖系统"),
//    LINKFHEAT(1294, "linkfheat","地暖联控"),
//    MUSIC(2304, "music","背景音乐"),
//    WATERDETE(2560, "waterdete","水精灵"),// 用于检测水质量
    AIRDETE("2816-1", DeviceEnum.AIR_SWITCH,"空气检测仪"),// 用于检测空气质量  空气盒子
//    TEMPHUMSEN(3072, "temphumsen","温湿度检测传感器"),// 用于检测室内温湿度
//    TEMPSEN(3073, "tempsen","温度检测传感器"),
//    HUMSEN(3074, "humsen","湿度检测传感器"),
//    TEMPHUMDISPLAY(3075, "temphumdisplay","温湿度显示面板"),
//    OCCUPANCYBODY(3076, "occupancybody","人体存在传感器"),
//    ALLSEN(3328, "allsen","所有安防设备"),
//    GASSEN(3329, "gassen","燃气探测器"),
//    BODYSEN(3330, "bodysen","人体红外探测器"),
    DOORSEN("3331-1", DeviceEnum.DOOR_WINDOW_SENSOR,"门磁");
//    IRSEN(3332, "irsen","红外幕帘"),
//    WATERSEN(3333, "watersen","水浸探测器"),
//    SMOKESEN(3334, "smokesen","烟感"),
//    KEYSEN(3335, "keysen","紧急按钮"),
//    DOORLOCK(3584, "doorlock","仿三星门锁"),
//    DOORLOCKSHSH505(3585, "doorlockshsh505","三星智能锁"),// 型号:SHS-H505 ，Z-WAVE  协议
//    DOORLOCKTAIXI(3586, "doorlocktaixi","太犀锁"),
//    DOORLOCKHBS(3587, "doorlockhbs","海贝斯锁"),
//    DOORLOCKHANHE(3588, "doorlockhanhe","韩和锁"),
//    PLUG(3840, "plug","插座"),
//    SMARTSIREN(4096, "smartsiren","智能报警器，声光报警器"),
//    SCENESELECTOR(4352, "sceneselector","场景面板"),
//    VOICECONTROLLER(4608, "智能语音控制面"),
//    TOGGLE_SWITCH(4864, "标准输入开关"),
//    RS485RTU(16384, "rs485rtu","485 RTU 透传模块"),
//    MUSICTIANLAI(16385, "天籁音乐盒子"),
//    MUSICDIANSHENG(16386, "典声音乐面板"),
//    MUSICYIJIAYIN(16387, "亿佳音音乐面板"),
//    MUSICSHENGBIKE(16388, "声必可音乐面板"),
//    AIRCONDITIONZHONGHONG(16640, "中弘非 MODBUS"),
//    AIRCONDITIONSUMG(16641, "三星空调"),
//    AIRCONDITIONWUHNG(16642, "五恒机"),
//    AIRCONDITIONDAJIN(16643, "大金空调"),
//    AIRCONDITIONRILI(16644, "日立空调(MODBUS)"),
//    AIRCONDITIONHAIER(16645, "海尔空调"),
//    AIRCONDITIONPANASONIC(16646, "松下空调"),
//    AIRCONDITIONHISENSE(16647, "海信空调"),
//    AIRCONDITIONLAFFEY(16648, "拉菲空调温控器"),
//    AIRCONDITIONLAFFEYMULT(16649, "拉菲空调温控器（三合一酒店轮询）"),
//    AIRCONDITIONDNKWUHNG(16650, "狄耐克五恒机"),
//    AIRCONDITIONZHONGHONLIN(16651, "中弘线控空调网关"),
//    AIRCONDITIONTOSHIBA(16652, "东芝空调"),
//    AIRCONDITIONMIDEA(16653, "美的空调"),
//    AIRCONDITIONTRANE(16654, "特灵空调"),
//    AIRCONDITIONMITSUBISHI(16655, "三菱空调"),
//    AIRCONDITIONFUJITSU(16656, "富士通空调"),
//    AIRCONDITIONGREE(16657, "格力空调"),
//    AIRCONDITIONHAIER2(16658, "海尔空调(MODBUS)"),
//    AIRCONDITIONALCATL(16658, "智能环境面板空调"),
//    AIRCONDITIONALCATLMULT(16660, "智能环境面板空调(三合一)"),
//    AIRCONDITIONXIMENG(16661, "西蒙空调面板"),
//    AIRFRESHXIMENG(16896, "西蒙新风面板"),
//    AIRFRESHNATHER(16897, "兰舍新风面板"),
//    AIRFRESHALDES(16898, "爱迪士新风"),
//    AIRFRESHBAILANG(16899, "百朗新风"),
//    AIRFRESHHAIER(16900, "海尔新风"),
//    AIRFRESHBULANG(16901, "布朗新风"),
//    AIRFRESHOKONOFF(16902, "柯耐弗新风"),
//    AIRFRESHDNAKE(16903, "狄耐克新风"),
//    AIRFRESHLAFFEY(16904, "拉菲新风"),
//    AIRFRESHMIDEA(16905, "美的新风"),
//    AIRFRESHHDK(16906, "环都拓普新风"),
//    AIRFRESLANGSIWEI(16907, "朗思威新风"),
//    AIRFRESLANGSHUJIA(16908, "舒家新风"),
//    AIRFRESPANASONIC(16909, "松下新风"),
//    AIRFRESRILI(16910, "日立新风"),
//    AIRFRESHONEYWELL(16911, "霍尼韦尔新风"),
//    AIRFRESSONGJING(16912, "松井新风"),
//    AIRFRESHHAIER2(169133, "海尔新风 2"),
//    AIRFRESHLEELEN(16914, "立林新风"),
//    AIRFRESHALCATL(16915, "智能环境面板新风"),
//    AIRFRESHKALUONI(16916, "卡洛尼新风"),
//    AIRFRESHNATHER2E(16917, "兰舍新风（L2E）"),
//    HEATERXIMENG(17152, "西蒙地热"),
//    HEATERYILIN(17153, "亿林取暖"),
//    HEATERVIRIDE(17154, "威瑞德地暖"),
//    HEATERHAILIN(17155, "海林地暖"),
//    HEATERMENRED(17156, "曼瑞德地暖"),
//    HEATERLAFFEYD8(17157, "拉菲地暖（D8 款）"),
//    HEATERXINYUAN(17158, "鑫源地暖"),
//    HEATERLAFFEYG1(17159, "拉菲地暖(G1 款)"),
//    HEATERDAVELL(17160, "大韦地暖"),
//    HEATERTOMILAKE(17161, "托米雷克地暖"),
//    HEATERALCATL(17162, "智能环境面板地暖"),
//    HEATERDERUI(17163, "德瑞地暖"),
//    HEATERSHUSHI(17164, "舒适管家地暖"),
//    MONITORRUIJIE(17408, "星网锐捷分机"),
//    MONITOR_902M(17409, "902 分机"),
//    MONITOR_280M(17410, "280 分机"),
//    LOCKTYPEYALE(17664, "耶鲁门锁（485 协议）"),
//    AIRCONDITIONSWLAFFEY(17920, "拉菲空调联动面板"),
//    AIRCONDITIONSWALCATL(17921, "智能环境面板空调联动面板"),
//    AIRFRESHSWLAFFEY_G1(18176, "拉菲新风联动面板 G1(按键屏)"),
//    AIRFRESHSWLAFFEY_D8(18177, "拉菲新风联动面板 D8（触控屏）"),
//    AIRFRESHSWALCATL(18178, "智能环境面板新风联动面板"),
//    HEATERSWLAFFEY_G1(18432, "拉菲地暖联动面板 G1(按键屏)"),
//    HEATERSWLAFFEY_D8(18433, "拉菲地暖联动面板 D8（触控屏）"),
//    RS485_TEMHUM_SENSOR(18688, "485 有线温湿度传感器"),
//    RS485_AIRQUALITYBOHU(18689, "485 有线伯虎空气盒子"),
//    RS485_CIRTBREAKER(18690, "485 空开断路器"),
//    AIRCONDITIONDNKWUHENG(18944, "环境智能被动能源一体机"),
//    ELECMOTORTYPELBEST(19200, "晾霸晾衣架"),
//    VIRTUALDEVICE(28672, "虚拟设备，主要用于服务器识别"),
//    COORDINATE(32768, "coordinate","协调器");

    private String code;
    DeviceEnum deviceEnum;
    private String desc;

    DnakeDeviceTypeEnum(String code, DeviceEnum deviceEnum, String desc) {
        this.code = code;
        this.desc = desc;
        this.deviceEnum = deviceEnum;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public DeviceEnum getDeviceEnum() {
        return deviceEnum;
    }

    public static DnakeDeviceTypeEnum getDeviceTypeEnumByCode(String code) {
        for (DnakeDeviceTypeEnum dnakeActionEnum : DnakeDeviceTypeEnum.values()) {
            if (dnakeActionEnum.getCode().equals(code)) {
                return dnakeActionEnum;
            }
        }
        return UNDEFINED;
    }

    public static DnakeDeviceTypeEnum getDeviceTypeEnumByType(String type) {
        for (DnakeDeviceTypeEnum dnakeActionEnum : DnakeDeviceTypeEnum.values()) {
            if (dnakeActionEnum.getDeviceEnum().getDeviceType().equals(type)) {
                return dnakeActionEnum;
            }
        }
        return UNDEFINED;
    }

}
